<!-- Begin: Wrapper Header -->
<div class="header hidden">
    <? Shell::showWidgets('wrapper-header') ?>
</div> <!-- End -->

<!-- Begin: Sidebar Left -->
<div class="sidebar left">
    <? Shell::showWidgets('sidebar-left') ?>                
</div> <!-- End -->

<!-- Begin: Content Product -->
<div class="content product">
    <div class="header">
        <h1>Produtos e Serviços</h1>
    </div>
    <div class="pictures">
        <ul>
            <? foreach (Product::$pictures as $pic) { ?>
                <li><a href="<?= _PDT_IMG_ ?>view/<?= $pic->filepicture; ?>" class="picturesproduct"><img src="<?= _PDT_IMG_ ?>deal/<?= $pic->filepicture; ?>"></a></li>
            <? } ?>
        </ul>
    </div>
    <div class="product-client">
        <div class="product-info">
            <h2><?= Product::$product->name; ?></h2>
            <div class="price">R$ <?= Util::format_money(Product::$product->price) ?></div>
            <div class="info">
                <strong>Descrição</strong>: <?= Product::$product->description ?><br/>
            </div>
        </div>
        <div class="product-client-info">
            <?
            if (Product::$client->type == 'J') {
                ?>
                <h2><?= Product::$client->fancyname; ?></h2>
                <div class="info">
                    <strong>Endereço</strong>: <?= Product::$client->address ?>, <?= Product::$client->number ?><br/>
                    <strong>Bairro</strong>: <?= Product::$client->district ?><br/>
                    <strong>Cidade</strong>: <?= Product::$client->ct_name ?> - <?= Product::$client->st_symbol ?><br/>
                    <strong>CEP</strong>: <?= Util::format_cep(Product::$client->cep) ?><br/>
                    <? if (Product::$client->contacts) { ?>
                        <strong>Contatos</strong>: <?= Product::$client->contacts ?>
                    <? } ?>
                    <div class="phones">
                        <? foreach (Product::$phones as $phone): ?>
                            <p><?= Util::format_phone($phone->areacode . $phone->number) ?></p>
                        <? endforeach ?>
                    </div>
                </div>
                <? if (Product::$client->filepicture != null) { ?>
                    <img src="<?= _ETP_IMG_ . 'normal/' . Product::$client->filepicture ?>" />
                <? } else { ?>
                    <img src="<?= _ETP_IMG_ ?>normal/no-image.jpg" />
                <? } ?>
                    asodijasiodj
            <? } else if (Product::$client->type == 'F') { ?>
                <h2><?= Product::$client->name; ?></h2>
                <div class="info">
                    <strong>Endereço</strong>: <?= Product::$client->address ?>, <?= Product::$client->number ?><br/>
                    <strong>Bairro</strong>: <?= Product::$client->district ?><br/>
                    <strong>Cidade</strong>: <?= Product::$client->ct_name ?> - <?= Product::$client->st_symbol ?><br/>
                    <strong>CEP</strong>: <?= Util::format_cep(Product::$client->cep) ?><br/>
                    <? if (Product::$client->contacts) { ?>
                        <strong>Contatos</strong>: <?= Product::$client->contacts ?>
                    <? } ?>
                </div>
                <div class="phones">
                    <? foreach (Product::$phones as $phone): ?>
                        <p><?= Util::format_phone($phone->areacode . $phone->number) ?></p>
                    <? endforeach ?>
                </div>
            <? } ?>
        </div>
    </div>
    <div class="form-proposal">
        <form id="proposal" class="product">
            <div class="name">
                <label>Nome:</label>
                <input class="input required" type="text" name="name" title="Nome">
            </div>
            <div class="phone">
                <label>Telefone:</label>
                <input class="input required" type="text" name="phone" title="Telefone">
            </div>
            <div class="email">
                <label>E-mail:</label>
                <input class="input required" type="text" name="email" title="E-mail">
            </div>
            <div class="message">
                <label>Mensagem:</label>
                <textarea class="input required message" name="message" title="Mensagem"></textarea>
            </div>
            <input type="hidden" name="id_product" value="<?= Product::$product->id; ?>" />
            <input class="submit" type="submit" value="Enviar Proposta" />
        </form>
    </div>
    <div class="other-products">
        <h1>Outros Produtos e Serviços</h1>
        <ul>
            <?
            if (Product::$lastproducts):
                foreach (Product::$lastproducts as $product):
                    $url = __BASE_URI__ . 'produto/' . $product->id;
                    ?>
                    <li>
                        <a class="picture" href="<?= $url ?>">
                            <img src="<?= _PDT_IMG_ . 'last-updated/' . $product->filepicture ?>" alt="<?= $product->p_name ?>" />
                        </a>
                        <a class="description" href="<?= $url ?>">
                            <h2><?= $product->p_name ?></h2>
                        </a>
                        <p class="price">R$ <?= Util::format_money($product->price) ?></p>
                    </li>
                    <?
                endforeach;
            else:
                ?>
                <li class="notfound">Nenhum produto ou serviço encontrado</li>
                <? endif ?>
        </ul>
    </div>
    <!-- End -->
</div>


